package com.tensquare.recruit.dao;

import com.tensquare.recruit.pojo.Recruit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * Created by WF on 2020/7/22 15:27
 */
public interface RecruitDao extends JpaRepository<Recruit,String>, JpaSpecificationExecutor<Recruit> {

    //1.根据创建日期倒序排序，状态为2，前4条
    List<Recruit> findTop4ByStateOrderByCreatetimeDesc(String state);
    //2.根据创建日期倒序排序，状态不为0，前12条
    List<Recruit> findTop12ByStateNotOrderByCreatetimeDesc(String state);
}
